package com.athui.bean.metadata;

import java.math.BigDecimal;

/**
 * @description: TODO 列的维度信息
 * @autor: zhangzhonghui
 * @create: 2024-08-03 10:44
 * @Version: 1.0
 */
public class ColumnMetaDataDim extends ColumnMetaDataRule {

    /**
     * @description: TODO 总条数
     * @autor: ${USER}
     * @create: 2024/8/1 18:07
     * @Version: 1.0
     **/
    private Long totalCount = 0L;

    /**
     * @description: TODO 空值数 只有字符串类型才会被统计
     * @autor: zhangzhonghui
     * @create: 2024/8/1 17:43
     * @Version: 1.0
     **/
    private Long emptyValueCount = 0L;
    /**
     * @description: TODO null值数
     * @autor: zhangzhonghui
     * @create: 2024/8/1 17:43
     * @Version: 1.0
     **/
    private Long nullValueCount = 0L;

    /**
     * @description: TODO 零值数 只有数值型才会被统计
     * @autor: zhangzhonghui
     * @create: 2024/8/2 08:33
     * @Version: 1.0
     **/
    private Long zeroValueCount = 0L;

    /**
     * @description: TODO 重复数
     * @autor: zhangzhonghui
     * @create: 2024/8/1 18:56
     * @Version: 1.0
     **/
    private Long repeatValueCount = 0L;

    /**
     * @description: TODO 非重复数 ,用于辅助 repeatValueCount 计算的
     * @autor: zhangzhonghui
     * @create: 2024/8/1 18:56
     * @Version: 1.0
     **/
    private Long notRepeatValueCount = 0L;

    /**
     * @description: TODO 计算不符合标准的数量
     *  需要引入标准代码，进行比较，记录不符合标准的数量
     * @autor: zhangzhonghui
     * @create: 2024/8/1 17:44
     * @Version: 1.0
     **/
    private Long nonStandardValueCount = 0L;

    /**
     * @description: TODO 数据合法性检查
     * 文本类型：应用范围，需要利用正则表达式，检查数据格式，记录不符合格式合规数，例如身份证号码、电话号码、邮箱等格式的检查。
     * 数值类型：应用范围，检查数值范围，比如定义的区间为60-100，但是事件的内容大于100 或小于60 这些都定义为不规范数据。
     * 日期类型：应用范围，检查日期范围，比如定义的区间为2020-01-01-2020-12-31，但是事件的内容大于2020-12-31 或小于2020-01-01 这些都定义为不规范数据。
     * @autor: ${USER}
     * @create: 2024/8/2 08:36
     * @Version: 1.0
     **/
    private Long illegalityValueCount = 0L;

    /**
     * @description: TODO  文本最小长度
     * @author: 阿辉大人
     * @create: 2024/8/3 19:25
     * @version: 1.0
    **/
    private Long textMinLength=99999L;

    /**
     * @description: TODO  文本最大长度
     * @author: 阿辉大人
     * @create: 2024/8/3 19:25
     * @version: 1.0
     **/
    private Long textMaxLength = 0L;

    /**
     * @description: TODO  数值最小值
     * @author: 阿辉大人
     * @create: 2024/8/3 19:25
     * @version: 1.0
     **/
    private BigDecimal numericalMinValue = BigDecimal.TEN;

    /**
     * @description: TODO  数值最大值
     * @author: 阿辉大人
     * @create: 2024/8/3 19:25
     * @version: 1.0
     **/
    private BigDecimal numericalMaxValue = BigDecimal.ZERO;

    /**
     * @description: TODO 无效值数量统计，
     * 应用场景：比如某列数据标注为数值型，但是在探查过程中发现存在非数值的值，例如 123abc 这类数据可标记为无效数据。
     * @author: 阿辉大人
     * @create: 2024/8/22 12:18
     * @version: 1.0
    **/
    private Long invalidValueCount=0L;

    /**
     * @description: TODO 关注数量统计
     * @author: 阿辉大人
     * @create: 2024/8/23 22:20
     * @version: 1.0
    **/
    private Long involvedValueCount=0L;

    public Long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
    }

    public Long getEmptyValueCount() {
        return emptyValueCount;
    }

    public void setEmptyValueCount(Long emptyValueCount) {
        this.emptyValueCount = emptyValueCount;
    }

    public Long getNullValueCount() {
        return nullValueCount;
    }

    public void setNullValueCount(Long nullValueCount) {
        this.nullValueCount = nullValueCount;
    }

    public Long getZeroValueCount() {
        return zeroValueCount;
    }

    public void setZeroValueCount(Long zeroValueCount) {
        this.zeroValueCount = zeroValueCount;
    }

    public Long getRepeatValueCount() {
        return this.totalCount - this.notRepeatValueCount;
    }

    public void setRepeatValueCount(Long repeatValueCount) {
        this.repeatValueCount = repeatValueCount;
    }

    public Long getNotRepeatValueCount() {
        return notRepeatValueCount;
    }

    public void setNotRepeatValueCount(Long notRepeatValueCount) {
        this.notRepeatValueCount = notRepeatValueCount;
    }

    public Long getIllegalityValueCount() {
        return illegalityValueCount;
    }

    public void setIllegalityValueCount(Long illegalityValueCount) {
        this.illegalityValueCount = illegalityValueCount;
    }

    public Long getNonStandardValueCount() {
        return nonStandardValueCount;
    }

    public void setNonStandardValueCount(Long nonStandardValueCount) {
        this.nonStandardValueCount = nonStandardValueCount;
    }

    public Long getTextMinLength() {
        return textMinLength;
    }

    public void setTextMinLength(Long textMinLength) {
        this.textMinLength = textMinLength;
    }

    public Long getTextMaxLength() {
        return textMaxLength;
    }

    public void setTextMaxLength(Long textMaxLength) {
        this.textMaxLength = textMaxLength;
    }

    public BigDecimal getNumericalMinValue() {
        return numericalMinValue;
    }

    public void setNumericalMinValue(BigDecimal numericalMinValue) {
        this.numericalMinValue = numericalMinValue;
    }

    public BigDecimal getNumericalMaxValue() {
        return numericalMaxValue;
    }

    public void setNumericalMaxValue(BigDecimal numericalMaxValue) {
        this.numericalMaxValue = numericalMaxValue;
    }

    public Long getInvalidValueCount() {
        return invalidValueCount;
    }

    public void setInvalidValueCount(Long invalidValueCount) {
        this.invalidValueCount = invalidValueCount;
    }

    public Long getInvolvedValueCount() {
        return involvedValueCount;
    }

    public void setInvolvedValueCount(Long involvedValueCount) {
        this.involvedValueCount = involvedValueCount;
    }

    @Override
    public void setInvolvedRange(String involvedRange) {
        // 设置 this.involvedValueCount = 0L，表示该列标记为关注列，设置关注的数据范围。
        this.involvedValueCount = 0L;
        super.setInvolvedRange(involvedRange);
    }

    @Override
    public String toString() {
        return "ColumnMetaDataDim{" +
                "totalCount=" + totalCount +
                ", emptyValueCount=" + emptyValueCount +
                ", nullValueCount=" + nullValueCount +
                ", zeroValueCount=" + zeroValueCount +
                ", repeatValueCount=" + repeatValueCount +
                ", notRepeatValueCount=" + notRepeatValueCount +
                ", nonStandardValueCount=" + nonStandardValueCount +
                ", illegalityValueCount=" + illegalityValueCount +
                ", textMinLength=" + textMinLength +
                ", textMaxLength=" + textMaxLength +
                ", numericalMinValue=" + numericalMinValue +
                ", numericalMaxValue=" + numericalMaxValue +
                '}';
    }
}
